import React, {Component} from 'react';
import {HashRouter,Route, Switch} from 'react-router-dom'
import Login from '@/components/Login'
import App from './App'
import history from '@/history'
import InterfaceMode from '@/pages/BasicSet/InterfaceMode'
import NoMatch from '@/pages/NoMatch'
import Admin from './Admin'
import Home from '@/pages/Home'
import Wan0 from '@/pages/BasicSet/Wan/wan0'
import Wan1 from '@/pages/BasicSet/Wan/wan1'
import LanSet from '@/pages/BasicSet/Lan/LanSet'

class Router extends Component {
    render() {
        return (
            <HashRouter history={history}>
                <App>
                    <Switch>
                        <Route exact path='/login' component={Login}/>
                        <Route path='/' render={() =>
                            <Admin>
                                <Switch>
                                    {/*<Route exact path='/' component={Home}/>*/}
                                    <Route exact path='/home' component={Home}/>
                                    <Route exact path='/basicSet/interfaceMode' component={InterfaceMode}/>
                                    {/*<Route exact path='/basicSet/wan/cell0' component={InterfaceMode}/>*/}
                                    {/*<Route exact path='/basicSet/wan/cell1' component={InterfaceMode}/>*/}
                                    <Route exact path='/basicSet/wan/wan0' component={Wan0}/>
                                    <Route exact path='/basicSet/wan/wan1' component={Wan1}/>
                                    <Route exact path='/basicSet/lan/lanSet' component={LanSet}/>
                                    <Route component={NoMatch}/>
                                </Switch>
                            </Admin>
                        }/>
                    </Switch>
                </App>
            </HashRouter>
        );
    }
}

export default Router;
